package com.fowo.api.sys.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fowo.api.sys.entity.SysLog;
import com.fowo.api.sys.mapper.SysLogMapper;
import com.fowo.api.sys.model.SysLogSearch;
import com.fowo.api.sys.service.SysLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void create(SysLog sysLog) {
        save(sysLog);
    }

    @Override
    public Page<SysLog> page(SysLogSearch search) {
        return baseMapper.searchPage(search.toPage(), search);
    }
}
